home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CICA Windows Explosion!
/
The CICA Windows Explosion! - Disc 2.iso
/
programr
/
rsxwdk2s.zip
/
RSXWDK
/
LIBSRC
/
DOS
/
DOS47.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-12-17
|
436b
|
27 lines
#include <errno.h>
#include <sys/doscalls.h>
/*
** AH = 0x47
** DS:SI name
*/
int dos_getcwd(unsigned char drive, char *name)
{
struct REGPACK r;
struct SEGPACK sr = { GetDS(), GetES()};
r.eax = 0x4700;
r.edx = drive;
SET_SEG_OFF(name, sr.ds, r.esi);
_intxr(0x21, &r, &sr);
if (r.eflags & 1) {
_sys_doserror2errno( r.eax & 0xFFFF);
return (-1);
}
else
return (0);
}